﻿using UnityEngine;
using System.Collections;

public class MicrowaveManager : EnemyBase 
{

	// Use this for initialization
    void Start() 
    {
        
	}

    override public void Init()
    {
        state = Global.State.Enabled;
        getRandomYpos();
        transform.position = new Vector3(startingXpos, startingYpos, transform.position.z);
        getRandomTimeInstantiate();
    }

    

    
	
	// Update is called once per frame
    void Update() 
    {
        if (state == Global.State.Enabled)
        {
            currentTimeInstansiate -= Time.deltaTime;

            if (isAlive == false && currentTimeInstansiate < 0)
            {
                isAlive = true;
            }

            if (isAlive == true)
            {
                transform.position = new Vector3(transform.position.x + speed * Time.deltaTime, transform.position.y, transform.position.z);
            }
        }
	}
}
